package com.ruoyi.quartz.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.YongyouXsfpMapper;
import com.ruoyi.quartz.domain.YongyouXsfp;
import com.ruoyi.quartz.service.IYongyouXsfpService;

/**
 * 销售发票Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-17
 */
@Service
public class YongyouXsfpServiceImpl implements IYongyouXsfpService 
{
    @Autowired
    private YongyouXsfpMapper yongyouXsfpMapper;

    /**
     * 查询销售发票
     * 
     * @param orgname 销售发票主键
     * @return 销售发票
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public YongyouXsfp selectYongyouXsfpByOrgname(String orgname)
    {
        return yongyouXsfpMapper.selectYongyouXsfpByOrgname(orgname);
    }

    /**
     * 查询销售发票列表
     * 
     * @param yongyouXsfp 销售发票
     * @return 销售发票
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<YongyouXsfp> selectYongyouXsfpList(YongyouXsfp yongyouXsfp)
    {
        return yongyouXsfpMapper.selectYongyouXsfpList(yongyouXsfp);
    }

    /**
     * 新增销售发票
     * 
     * @param yongyouXsfp 销售发票
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertYongyouXsfp(YongyouXsfp yongyouXsfp)
    {
        return yongyouXsfpMapper.insertYongyouXsfp(yongyouXsfp);
    }

    /**
     * 修改销售发票
     * 
     * @param yongyouXsfp 销售发票
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateYongyouXsfp(YongyouXsfp yongyouXsfp)
    {
        return yongyouXsfpMapper.updateYongyouXsfp(yongyouXsfp);
    }

    /**
     * 批量删除销售发票
     * 
     * @param orgnames 需要删除的销售发票主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouXsfpByOrgnames(String[] orgnames)
    {
        return yongyouXsfpMapper.deleteYongyouXsfpByOrgnames(orgnames);
    }

    /**
     * 删除销售发票信息
     * 
     * @param orgname 销售发票主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouXsfpByOrgname(String orgname) {
        return yongyouXsfpMapper.deleteYongyouXsfpByOrgname(orgname);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouXsfpByDate(String vouchdate) {
        return yongyouXsfpMapper.deleteYongyouXsfpByDate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int clearXsfp() {
        return yongyouXsfpMapper.clearXsfp();
    }
}
